package com.itheima.date;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

public class DateTest {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);

        int year = now.getYear();
        System.out.println("year = " + year);

        int month = now.getMonthValue();
        System.out.println("month = " + month);

        int dayOfYear = now.getDayOfYear();
        System.out.println("dayOfYear = " + dayOfYear);

        int dayOfMonth = now.getDayOfMonth();
        System.out.println("dayOfMonth = " + dayOfMonth);

        DayOfWeek dayOfWeek = now.getDayOfWeek();
        int week = dayOfWeek.getValue();
        System.out.println("week = 星期" + week);

        int hour = now.getHour();
        System.out.println("hour = " + hour);

        int minute = now.getMinute();
        System.out.println("minute = " + minute);

        int second = now.getSecond();
        System.out.println("second = " + second);
    }
}
